//
//  MemberSubscriberItemView.swift
//  btvideo
//
//  Created by mac on 2020/9/24.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit

class ST_MemberSubscriberTopDescribeView: UIControl {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.addSubview(imageView)
        imageView.snp.makeConstraints { (make) in
            make.width.height.equalTo(85)
            make.centerX.equalToSuperview()
            make.top.equalToSuperview().offset(60)
        }
        
        
        self.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { (make) in
            make.height.equalTo(28)
            make.centerX.equalToSuperview()
            make.top.equalTo(imageView.snp.bottom).offset(20)
        }
        
        
        self.addSubview(content_label)
        content_label.snp.makeConstraints { (make) in
            make.height.equalTo(20)
            make.centerX.equalToSuperview()
            make.top.equalTo(titleLabel.snp.bottom).offset(5)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    fileprivate lazy var imageView:UIImageView = {
         let control = UIImageView()
          control.contentMode = .scaleAspectFill
          return control
      }()
    
    fileprivate lazy var titleLabel:UILabel = {
        let control = UILabel.init()
        control.text = ""
        control.textColor = UIColor(hexString: "#333333")
        control.textAlignment = .center
        control.font = UIFont.systemFont(ofSize: 20, weight: UIFont.Weight.semibold)
        return control
    }()
    fileprivate lazy var content_label:UILabel = {
        let control = UILabel.init()
        control.text = ""
        control.textColor = UIColor(hexString: "#333333")
        control.numberOfLines = 0
        control.textAlignment = .center
        control.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.regular)
        return control
    }()

    var model:ST_MemberSubscriberItemViewStruct?{
        didSet{
            
            guard let m = model else{return}
            
            titleLabel.text = m.title
            
            content_label.text = m.subTitle
            
            imageView.image = UIImage.init(named: m.imageName)
        }
    }
}


//MARK: - Struct

struct ST_MemberSubscriberItemViewStruct {
    
    var imageName:String
    var title:String
    var subTitle:String
    
    static func normal_struct_datasource()->[ST_MemberSubscriberItemViewStruct]{
        
        return [ST_MemberSubscriberItemViewStruct.init(imageName: "SubscriberIcon_0", title: "每日20次喜欢", subTitle: "突破限制，尽情喜欢"),ST_MemberSubscriberItemViewStruct.init(imageName: "SubscriberIcon_1", title: "查看谁喜欢我", subTitle: "立即配对，成为好友"),ST_MemberSubscriberItemViewStruct.init(imageName: "SubscriberIcon_2", title: "筛选最想看的人", subTitle: "对条件组合筛选最满意的人"),ST_MemberSubscriberItemViewStruct.init(imageName: "SubscriberIcon_3", title: "精准搜人", subTitle: "输入昵称特质，精准找人"),ST_MemberSubscriberItemViewStruct.init(imageName: "SubscriberIcon_4", title: "开启隐身模式", subTitle: "在所有版块不可被看见"),ST_MemberSubscriberItemViewStruct.init(imageName: "SubscriberIcon_5", title: "金色昵称", subTitle: "你是伴心最闪亮的崽"),ST_MemberSubscriberItemViewStruct.init(imageName: "SubscriberIcon_6", title: "专属标识", subTitle: "伴心会员专属牌面")]
    }
    
    
}
